<?php
	
	include("helper/DBOperation.php");
	$is_ajax = $_REQUEST['is_ajax'];
	
	if(isset($is_ajax) && $is_ajax)
	{
		$dbObj = new DBOperation();	
		$username = $_REQUEST['username'];
		$password = $_REQUEST['password'];
		//echo "<pre>";print_r($_REQUEST);exit;
		$userQry = "select * from tbl_users where username='".$username."' and password = '".md5($password)."' limit 0,1";
		$result = $dbObj->executeQuery($userQry,true);
		if(!empty($result['id'])){
			$_SESSION['userslog'] = $result;
			//$updateDate = date("Y-m-d h:i:s");
			//$update_record = $dbObj->updateRecords('tbl_users', 
			//			array('last_login_date'=> $updateDate), 
			//			array('id' => $result['id']), 1);
			//echo $update_record;	
			
			echo 1;
		}else{
			echo 0;
		}		
			
	}
	
?>